package cmd

import (
	"gitee.com/okatu-loli/oc_contributor_fanyuxiao/pkg/coverage"
	"github.com/spf13/cobra"
)

var runtimeDepsPath string

// coverageCmd runs tests with coverage and analyzes runtime dependencies.
var coverageCmd = &cobra.Command{
	Use:   "coverage",
	Short: "generate test coverage and report dependency coverage",
	RunE: func(cmd *cobra.Command, args []string) error {
		return coverage.Generate(runtimeDepsPath)
	},
}

func init() {
	rootCmd.AddCommand(coverageCmd)
	coverageCmd.Flags().StringVar(&runtimeDepsPath, "deps", "runtime_deps.json", "path to runtime deps json")
}
